<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: MywikiController</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">MywikiController</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../files/app/controllers/mywiki_controller_rb.html">
                app/controllers/mywiki_controller.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="ApplicationController.html">
                ApplicationController
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
MyWiki is a program based on Ruby on <a href="Rails.html">Rails</a>
developed as part of a class project for the Fall 2008 session on CmpE 275
at SJSU. This program sets up a Wiki system supporting creating, editing,
and deleting rich text pages. It supports built in full text <a
href="MywikiController.html#M000058">search</a> on page titles, tags,
description and body, using Ferret RoR module. This program also supports a
rich text based editor using TinyMCE plugin with added functionality of
identifying and converting WikiWords to URL and supporting raw wiki text
editing using RedCloth gem.
</p>
<table>
<tr><td valign="top">Author:</td><td>Sonali Goel (mailto: sonaligoel83@gmail.com)

</td></tr>
<tr><td valign="top">Copyright:</td><td>Copyright (c) SJSU 2008

</td></tr>
</table>
<p>
This class defines the user action supported by the program
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000052">create</a>&nbsp;&nbsp;
      <a href="#M000057">destroy</a>&nbsp;&nbsp;
      <a href="#M000048">dologin</a>&nbsp;&nbsp;
      <a href="#M000053">edit</a>&nbsp;&nbsp;
      <a href="#M000056">help</a>&nbsp;&nbsp;
      <a href="#M000050">index</a>&nbsp;&nbsp;
      <a href="#M000060">load_test_data</a>&nbsp;&nbsp;
      <a href="#M000047">login</a>&nbsp;&nbsp;
      <a href="#M000049">logout</a>&nbsp;&nbsp;
      <a href="#M000059">method_missing</a>&nbsp;&nbsp;
      <a href="#M000051">new</a>&nbsp;&nbsp;
      <a href="#M000058">search</a>&nbsp;&nbsp;
      <a href="#M000054">update</a>&nbsp;&nbsp;
      <a href="#M000055">view</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000052" class="method-detail">
        <a name="M000052"></a>

        <div class="method-heading">
          <a href="MywikiController.src/M000052.html" target="Code" class="method-signature"
            onclick="popupCode('MywikiController.src/M000052.html');return false;">
          <span class="method-name">create</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
called from <a href="MywikiController.html#M000051">new</a> page creation
</p>
        </div>
      </div>

      <div id="method-M000057" class="method-detail">
        <a name="M000057"></a>

        <div class="method-heading">
          <a href="MywikiController.src/M000057.html" target="Code" class="method-signature"
            onclick="popupCode('MywikiController.src/M000057.html');return false;">
          <span class="method-name">destroy</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
If user has delete permission delete the specified page specified by :id,
otherwise redirect user to mywiki <a
href="MywikiController.html#M000050">index</a> page.
</p>
        </div>
      </div>

      <div id="method-M000048" class="method-detail">
        <a name="M000048"></a>

        <div class="method-heading">
          <a href="MywikiController.src/M000048.html" target="Code" class="method-signature"
            onclick="popupCode('MywikiController.src/M000048.html');return false;">
          <span class="method-name">dologin</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Called from the <a href="MywikiController.html#M000047">login</a> page to
<a href="MywikiController.html#M000052">create</a> user session. Expects
user as parameter.
</p>
        </div>
      </div>

      <div id="method-M000053" class="method-detail">
        <a name="M000053"></a>

        <div class="method-heading">
          <a href="MywikiController.src/M000053.html" target="Code" class="method-signature"
            onclick="popupCode('MywikiController.src/M000053.html');return false;">
          <span class="method-name">edit</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
If user has <a href="MywikiController.html#M000053">edit</a> permission,
show <a href="MywikiController.html#M000053">edit</a> existing page form,
otherwise redirect user to mywiki <a
href="MywikiController.html#M000050">index</a> page. Trying to <a
href="MywikiController.html#M000053">edit</a> non existent page will be
redirected to creating <a href="MywikiController.html#M000051">new</a> page
with the same title.
</p>
        </div>
      </div>

      <div id="method-M000056" class="method-detail">
        <a name="M000056"></a>

        <div class="method-heading">
          <a href="MywikiController.src/M000056.html" target="Code" class="method-signature"
            onclick="popupCode('MywikiController.src/M000056.html');return false;">
          <span class="method-name">help</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Display the <a href="MywikiController.html#M000056">help</a> page. All
logged in users have access.
</p>
        </div>
      </div>

      <div id="method-M000050" class="method-detail">
        <a name="M000050"></a>

        <div class="method-heading">
          <a href="MywikiController.src/M000050.html" target="Code" class="method-signature"
            onclick="popupCode('MywikiController.src/M000050.html');return false;">
          <span class="method-name">index</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
If the user is logged in, display mywiki home page
</p>
        </div>
      </div>

      <div id="method-M000060" class="method-detail">
        <a name="M000060"></a>

        <div class="method-heading">
          <a href="MywikiController.src/M000060.html" target="Code" class="method-signature"
            onclick="popupCode('MywikiController.src/M000060.html');return false;">
          <span class="method-name">load_test_data</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000047" class="method-detail">
        <a name="M000047"></a>

        <div class="method-heading">
          <a href="MywikiController.src/M000047.html" target="Code" class="method-signature"
            onclick="popupCode('MywikiController.src/M000047.html');return false;">
          <span class="method-name">login</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Display the <a href="MywikiController.html#M000047">login</a> page
</p>
        </div>
      </div>

      <div id="method-M000049" class="method-detail">
        <a name="M000049"></a>

        <div class="method-heading">
          <a href="MywikiController.src/M000049.html" target="Code" class="method-signature"
            onclick="popupCode('MywikiController.src/M000049.html');return false;">
          <span class="method-name">logout</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
call to <a href="MywikiController.html#M000049">logout</a> of system
</p>
        </div>
      </div>

      <div id="method-M000059" class="method-detail">
        <a name="M000059"></a>

        <div class="method-heading">
          <a href="MywikiController.src/M000059.html" target="Code" class="method-signature"
            onclick="popupCode('MywikiController.src/M000059.html');return false;">
          <span class="method-name">method_missing</span><span class="method-args">( *args )</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
<a href="Access.html">Access</a> to /mywiki/&lt;anything&gt; from url will
be redirected to viewing wiki page with title &lt;anything&gt;
</p>
        </div>
      </div>

      <div id="method-M000051" class="method-detail">
        <a name="M000051"></a>

        <div class="method-heading">
          <a href="MywikiController.src/M000051.html" target="Code" class="method-signature"
            onclick="popupCode('MywikiController.src/M000051.html');return false;">
          <span class="method-name">new</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
If the user has <a href="MywikiController.html#M000052">create</a>
permission, display <a href="MywikiController.html#M000051">new</a> page
creation form, otherwise redirect to mywiki <a
href="MywikiController.html#M000050">index</a>.
</p>
        </div>
      </div>

      <div id="method-M000058" class="method-detail">
        <a name="M000058"></a>

        <div class="method-heading">
          <a href="MywikiController.src/M000058.html" target="Code" class="method-signature"
            onclick="popupCode('MywikiController.src/M000058.html');return false;">
          <span class="method-name">search</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Display the <a href="MywikiController.html#M000058">search</a> page
</p>
        </div>
      </div>

      <div id="method-M000054" class="method-detail">
        <a name="M000054"></a>

        <div class="method-heading">
          <a href="MywikiController.src/M000054.html" target="Code" class="method-signature"
            onclick="popupCode('MywikiController.src/M000054.html');return false;">
          <span class="method-name">update</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Update called when submitting <a
href="MywikiController.html#M000053">edit</a> form
</p>
        </div>
      </div>

      <div id="method-M000055" class="method-detail">
        <a name="M000055"></a>

        <div class="method-heading">
          <a href="MywikiController.src/M000055.html" target="Code" class="method-signature"
            onclick="popupCode('MywikiController.src/M000055.html');return false;">
          <span class="method-name">view</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
If user has read permission, <a
href="MywikiController.html#M000055">view</a> the specified wiki page,
otherwise redirect to <a href="MywikiController.html#M000047">login</a>
page. If the page does not exist, user is redirected to creating <a
href="MywikiController.html#M000051">new</a> page with the specified title.
</p>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>